<html>
<head>
<title>完整注册</title>
<include file="SPGPub:header" />
<script src="{cms>:RES}/js/zepto.min.js"></script>
</head>

<body>
	
	<header class="titlebar">
		<a href="javascript:window.history.go(-1)">返回</a>
		<h1>完整注册</h1>
	</header>

	<div class="container">
		<div class="box">
			<form id="registForm" method="post" class="paddingform" style="margin-top: -10px">
				
				<div>
					<label for="companyName">公司名称</label>
					<input id="companyName" name="companyName" type="text" value="" placeholder="公司名称" />
					<label for="companySet">公司或SET编号</label>
					<input id="companySet" name="companySet" type="text" value="" placeholder="公司或SET编号" />
				</div>
				<hr class="purpleline"/>
				<div>
					<label for="validate">口头验证</label>
					<input id="validate" name="validate" type="password" value="" placeholder="仅限罗马字符" />
				</div>
				
				<hr class="purpleline"/>
				<div>
					<label>联络偏好设置</label>
						<div class="checkBoxDiv" style="margin-top: 10px;">
							<input type="checkbox" checked="checked" id="ph_zd" name="ph_zd" />
							<label for="ph_zd"></label>
							<label for="ph_zd">SPG俱乐部电子账单</label>
						</div>
						
						<div class="checkBoxDiv">
							<input type="checkbox" checked="checked" id="ph_hd" name="ph_hd" />
							<label for="ph_hd"></label>
							<label for="ph_hd">SPG俱乐部会员推广活动</label>
						</div>
						
						<div class="checkBoxDiv">
							<input type="checkbox" checked="checked" id="ph_yh" name="ph_yh" />
							<label for="ph_yh"></label>
							<label for="ph_yh">酒店及度假村特色与优惠</label>
						</div>
						
						<div class="checkBoxDiv">
							<input type="checkbox" checked="checked" id="ph_dc" name="ph_dc" />
							<label for="ph_dc"></label>
							<label for="ph_dc">客人住宿/市场问卷调查</label>
						</div>
						
						<div class="checkBoxDiv">
							<input type="checkbox" id="ph_no" name="ph_no" />
							<label for="ph_no"></label>
							<label for="ph_no">请勿给我发送任何电子邮件</label>
						</div>
				</div>
				
				<hr class="purpleline"/>
				<div>
					<label>首选语言</label>
					<select>
						<option>中文（普通话）</option>
						<option>中文（繁体）</option>
						<option>德语</option>
						<option>日语</option>
						<option>法语</option>
						<option>英语</option>
					</select>
				</div>
				<hr class="purpleline"/>
				<div>
					<label>生日</label>
					<select id="yy" name="year" onchange="prepareDay();" require="notdefault" default="0" error="请选择年份">
						<option value="0">年份</option>
					</select>
					<br/>
					<br/>
					<select id="month" name="month" onchange="prepareDay();" require="notdefault" default="0" error="请选择月份">
						<option value="0">月份</option>
						<option value="1">1</option>
						<option value="2">2</option>
						<option value="3">3</option>
						<option value="4">4</option>
						<option value="5">5</option>
						<option value="6">6</option>
						<option value="7">7</option>
						<option value="8">8</option>
						<option value="9">9</option>
						<option value="10">10</option>
						<option value="11">11</option>
						<option value="12">12</option>
					</select>
					<br/>
					<br/>
					<select id="day" name="day" require="notdefault" default="0" error="请选择日期">
						<option value="0">日期</option>
					</select>
				</div>
				<hr class="purpleline"/>
				<div>
				<br/>
					<button type="submit" class="btn">完成</button>
				</div>
			</form>
		</div>
	</div>
	
	<include file="SPGPub:footer" />
	
<script src="{cms>:RES}/js/validate.js"></script>
<script type="text/javascript">
	
	$(function(){
		$('#registForm').validate();
		prepareYear();
	});

	function prepareYear(){
		var start = 1920;
		var end = (new Date()).getFullYear();
		
		var year = $('#yy');
		
		for(var i=start;i<=end;i++){
			var opStr = "<option value='" + i +"'>"+ i +"</option>"
			year.append(opStr);
		}
	}

	function prepareDay(){
		var year = $('#yy').val();
		var month = $('#month').val();
		
		var day = $('#day');
		var dayval = day.val();
		
		var end = 31;
		day.html('<option value="0">日期</option>');
		if(month == 2 ){
			if((year%4) == 0){
				end = 29;
			}else{
				end = 28;
			}
		}else if(month == 4 || month == 6 || month == 9 || month == 11){
			end = 30;
		}
		for(var i=1;i<=end;i++){
			var select = '';
			
			if(i== dayval){
				select = 'selected="selected"';
			}
			var opStr = "<option value='" + i +"'"+ select +">"+ i +"</option>"
			day.append(opStr);
		}
	}
</script>

</body>
</html>
